package com.muyu.breakdown.controller;

import com.muyu.breakdown.domain.SysCarFaultLog;
import com.muyu.breakdown.service.SysCarFaultLogService;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.web.controller.BaseController;
import com.muyu.common.core.web.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ClassDescription:
 * @JdkVersion: 1.8
 * @Author: YZL
 * @Created: 2024/9/22 21:08
 */
@RestController
@RequestMapping("/log")
public class sysCarFaultLogController extends BaseController {
    @Autowired
    private SysCarFaultLogService service;

    @PostMapping("/list")
    public Result<TableDataInfo<SysCarFaultLog>> list(@RequestBody SysCarFaultLog sysCarFaultLog){
        startPage();
        List<SysCarFaultLog> list = service.selectSysCarFaultLogList(sysCarFaultLog);
        return getDataTable(list);
    }

    @PostMapping("/listStatusIgnore")
    public Result<TableDataInfo<SysCarFaultLog>>listStatusIgnore(@RequestBody  SysCarFaultLog sysCarFaultLog){
        startPage();
        List<SysCarFaultLog> list = service.listStatusIgnore(sysCarFaultLog);
        return getDataTable(list);
    }




    @PostMapping("/listStatusSolve")
    public Result<TableDataInfo<SysCarFaultLog>>listStatusSolve(@RequestBody SysCarFaultLog sysCarFaultLog){
        startPage();
        List<SysCarFaultLog> list = service.listStatusSolve(sysCarFaultLog);
        return getDataTable(list);
    }

    @PostMapping("/listStatusProcess")
    public Result<TableDataInfo<SysCarFaultLog>>listStatusProcess(@RequestBody SysCarFaultLog sysCarFaultLog){
        startPage();
        List<SysCarFaultLog> list = service.listStatusProcess(sysCarFaultLog);
        return getDataTable(list);
    }

    @PostMapping("/add")
    public Result<Integer> add(@RequestBody SysCarFaultLog sysCarFaultLog){

        return toAjax(service.save(sysCarFaultLog));
    }

}
